From 507f134c8d62af8655202536e1238931d602665c Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 5 Dec 2002 18:45:35 +0000 Subject: [PATCH] Misc language cleanups. --- gpsbabel/defs.h | 7 ++++--- gpsbabel/gpx.c | 4 ++-- gpsbabel/jeeps/gpssend.c | 2 +- gpsbabel/jeeps/gpsserial.c | 6 +++--- gpsbabel/jeeps/gpsserial.h | 4 +++- gpsbabel/jeeps/gpsutil.h | 2 ++ gpsbabel/main.c | 1 + gpsbabel/mapsend.h | 2 +- gpsbabel/mkshort.c | 2 +- gpsbabel/util.c | 1 + gpsbabel/vecs.c | 37 +++++++++++++++++++++++++------------ 11 files changed, 44 insertions(+), 24 deletions(-) diff --git a/gpsbabel/defs.h b/gpsbabel/defs.h index 6fa85c6ef..fbc728b29 100644 --- a/gpsbabel/defs.h +++ b/gpsbabel/defs.h @@ -157,7 +157,7 @@ typedef void (*route_trl)(const route_head *); void waypt_add (waypoint *); void waypt_del (waypoint *); void waypt_disp_all(waypt_cb); -void route(route_hdr, route_trl, waypt_cb); +void route_disp_all(route_hdr, route_trl, waypt_cb); unsigned int waypt_count(void); route_head *route_head_alloc(void); @@ -190,12 +190,13 @@ void fatal(const char *, ...) ; ff_vecs_t *find_vec(char *, char **); void disp_vecs(void); +void disp_formats(void); void printposn(const coord *c, int is_lat); void *xcalloc(size_t nmemb, size_t size); void *xmalloc(size_t size); -char * xstrdup(const char *s); - +char *xstrdup(const char *s); +void *rtrim(char *s); /* * PalmOS records like fixed-point numbers, which should be rounded diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index fffdf0523..8a29a826e 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -353,7 +353,7 @@ gpx_waypt_pr(const waypoint *waypointp) } static void -gpx_track_hdr(route_head *rte) +gpx_track_hdr(const route_head *rte) { fprintf(ofd, "\n"); if (rte->rte_name) { @@ -381,7 +381,7 @@ gpx_track_disp(const waypoint *waypointp) } static void -gpx_track_tlr(route_hdr *rte) +gpx_track_tlr(const route_head *rte) { fprintf(ofd, "\n"); fprintf(ofd, "\n"); diff --git a/gpsbabel/jeeps/gpssend.c b/gpsbabel/jeeps/gpssend.c index c33149d7e..59370b5c1 100644 --- a/gpsbabel/jeeps/gpssend.c +++ b/gpsbabel/jeeps/gpssend.c @@ -117,7 +117,7 @@ int32 GPS_Write_Packet(int32 fd, GPS_PPacket packet) GPS_Diag("\nTx Data:"); Diag(&packet->dle, 3); - if((ret=GPS_Serial_Write(fd,(const void *)&packet->dle,(size_t)3)) == -1) + if((ret=GPS_Serial_Write(fd,(const void *) &packet->dle,(size_t)3)) == -1) { perror("write"); GPS_Error("SEND: Write to GPS failed"); diff --git a/gpsbabel/jeeps/gpsserial.c b/gpsbabel/jeeps/gpsserial.c index b3f8e37bb..546344571 100644 --- a/gpsbabel/jeeps/gpsserial.c +++ b/gpsbabel/jeeps/gpsserial.c @@ -116,7 +116,7 @@ int32 GPS_Serial_Flush(int32 fd) return 1; } -int32 GPS_Serial_Write(int ignored, void *obuf, int size) +int32 GPS_Serial_Write(int32 ignored, const void *obuf, int size) { DWORD len; WriteFile (comport, obuf, size, &len, NULL); @@ -126,7 +126,7 @@ int32 GPS_Serial_Write(int ignored, void *obuf, int size) return len; } -int GPS_Serial_Read(int ignored, void *ibuf, int size) +int GPS_Serial_Read(int32 ignored, void *ibuf, int size) { DWORD cnt; @@ -272,7 +272,7 @@ int32 GPS_Serial_Read(int32 handle, void *ibuf, int size) return read(handle, ibuf, size); } -int32 GPS_Serial_Write(int32 handle, void *obuf, int size) +int32 GPS_Serial_Write(int32 handle, const void *obuf, int size) { return write(handle, obuf, size); } diff --git a/gpsbabel/jeeps/gpsserial.h b/gpsbabel/jeeps/gpsserial.h index b1f370185..1849cd01c 100644 --- a/gpsbabel/jeeps/gpsserial.h +++ b/gpsbabel/jeeps/gpsserial.h @@ -21,7 +21,9 @@ int32 GPS_Serial_On(const char *port, int32 *fd); int32 GPS_Serial_Off(const char *port, int32 fd); int32 GPS_Serial_Wait(int32 fd); int32 GPS_Serial_Flush(int32 fd); -int32 GPS_Serial_On_NMEA(const char *port, int32 *fd); +int32 GPS_Serial_On_NMEA(const char *port, int32 *fd); +int32 GPS_Serial_Read(int32 ignored, void *ibuf, int size); +int32 GPS_Serial_Write(int32 ignored, const void *obuf, int size); #endif diff --git a/gpsbabel/jeeps/gpsutil.h b/gpsbabel/jeeps/gpsutil.h index 245824208..30027885c 100644 --- a/gpsbabel/jeeps/gpsutil.h +++ b/gpsbabel/jeeps/gpsutil.h @@ -35,6 +35,8 @@ void GPS_User(char *s); void GPS_Disable_User(void); void GPS_Enable_User(void); void GPS_Diagnose(int32 c); +void GPS_Diag(const char *fmt, ...); + void GPS_Enable_Diagnose(void); void GPS_Disable_Diagnose(void); diff --git a/gpsbabel/main.c b/gpsbabel/main.c index 1f02afc11..f31940525 100644 --- a/gpsbabel/main.c +++ b/gpsbabel/main.c @@ -19,6 +19,7 @@ #include "defs.h" +#include global_options global_opts; diff --git a/gpsbabel/mapsend.h b/gpsbabel/mapsend.h index 55ca4b5df..3c77b3320 100644 --- a/gpsbabel/mapsend.h +++ b/gpsbabel/mapsend.h @@ -40,5 +40,5 @@ typedef enum { ms_type_rgn = 0, ms_type_wpt = 1, ms_type_track = 2, - ms_type_log = 3, + ms_type_log = 3 } ms_type; diff --git a/gpsbabel/mkshort.c b/gpsbabel/mkshort.c index 8b29731d3..a551750d4 100644 --- a/gpsbabel/mkshort.c +++ b/gpsbabel/mkshort.c @@ -196,7 +196,7 @@ mkshort(const char *istring) * Now brutally truncate the resulting string, preserve trailing * numeric data. */ - if ((i = strlen(ostring)) > target_len) { + if ((/*i = */strlen(ostring)) > target_len) { strcpy(&ostring[target_len] - strlen(np), np); } return ostring; diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 2a581c74f..a56a1954c 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -22,6 +22,7 @@ #include "defs.h" #include #include +#include void * xmalloc(size_t size) diff --git a/gpsbabel/vecs.c b/gpsbabel/vecs.c index b01358257..193f6f387 100644 --- a/gpsbabel/vecs.c +++ b/gpsbabel/vecs.c @@ -64,7 +64,8 @@ vecs_t vec_list[] = { { &gpsman_vecs, "gpsman", - "GPSman" + "GPSman", + NULL }, { &gpx_vecs, @@ -75,12 +76,14 @@ vecs_t vec_list[] = { { &mag_vecs, "magellan", - "Magellan protocol" + "Magellan protocol", + NULL }, { &mapsend_vecs, "mapsend", - "Magellan Mapsend" + "Magellan Mapsend", + NULL }, { &pcx_vecs, @@ -98,22 +101,26 @@ vecs_t vec_list[] = { { &gpsutil_vecs, "gpsutil", - "gpsutil" + "gpsutil", + NULL }, { &tiger_vecs, "tiger", - "U.S. Census Bureau Tiger Mapping Service" + "U.S. Census Bureau Tiger Mapping Service", + NULL }, { &csv_vecs, "csv", - "Comma separated values" + "Comma separated values", + NULL }, { &xmap_vecs, "xmap", - "Delorme Topo USA4/XMap Conduit" + "Delorme Topo USA4/XMap Conduit", + NULL }, { &dna_vecs, @@ -130,22 +137,26 @@ vecs_t vec_list[] = { { &cetus_vecs, "cetus", - "Cetus for Palm/OS" + "Cetus for Palm/OS", + NULL }, { &gpspilot_vecs, "gpspilot", - "GPSPilot Tracker for Palm/OS" + "GPSPilot Tracker for Palm/OS", + NULL }, { &magnav_vec, "magnav", - "Magellan NAV Companion for PalmOS" + "Magellan NAV Companion for PalmOS", + NULL }, { &garmin_vecs, "garmin", - "Garmin serial protocol" + "Garmin serial protocol", + NULL }, { &mxf_vecs, @@ -180,10 +191,12 @@ vecs_t vec_list[] = { { &gpsdrive_vecs, "gpsdrive", - "GpsDrive Format" + "GpsDrive Format", + NULL }, { + NULL, NULL, NULL, NULL -- 2.30.2